/**
 * @Title: DemoServiceImpl.java
 * @Package com.ruiyi.careryun.service.demo.impl
 * @Description: TODO(用一句话描述该文件做什么)
 * @author A18ccms A18ccms_gmail_com
 * @date 2017年3月31日 下午4:39:03
 * @version V1.0
 */
package com.ruiyi.careryun.service.demo.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ruiyi.careryun.beans.user.Role;
import com.ruiyi.careryun.beans.user.UserInfo;
import com.ruiyi.careryun.mapper.demo.DemoMapper;
import com.ruiyi.careryun.mongodb.RoleRepository;
import com.ruiyi.careryun.mongodb.UserInfoRepository;
import com.ruiyi.careryun.service.demo.DemoService;

/**
 * @ClassName: DemoServiceImpl
 * @Description:
 * @author tao.zeng
 * @date 2017年3月31日 下午4:39:03
 */
@Service
@Transactional
public class DemoServiceImpl implements DemoService {
    @Autowired
    private DemoMapper demoMapper;
    @Autowired
    private UserInfoRepository userInfoRepository;
    @Autowired
    private RoleRepository roleRepository;

    /*
     * (非 Javadoc) <p>Title: testTransaction</p> <p>Description: </p>
     * @see com.ruiyi.careryun.service.demo.DemoService#testTransaction()
     */
    @Override
    public void addTestTransaction() {
        System.out.println(1);
        demoMapper.addTestTransaction();
        demoMapper.addTestException();
    }

    @Override
    public void testMongoAdd() {
        roleRepository.insert(new Role("管理员"));
        userInfoRepository.insert(new UserInfo("18384280421", "kennedy", "863468390@qq.com"));
    }

}
